package edu.nju.mutest.visitor.collector;

import com.github.javaparser.ast.expr.*;
import com.github.javaparser.ast.visitor.VoidVisitorAdapter;

import java.util.List;

/**
 * Collect numeric literal expression(int, double, long);
 * example: 1, 123l, 3.24
 */
public class NumericLiteralCollector extends VoidVisitorAdapter<List<Expression>> {

    @Override
    public void visit(IntegerLiteralExpr n, List<Expression> collector) {
        super.visit(n, collector);
        collector.add(n);
    }

    @Override
    public void visit(LongLiteralExpr n, List<Expression> collector) {
        super.visit(n, collector);
        collector.add(n);
    }

    @Override
    public void visit(DoubleLiteralExpr n, List<Expression> collector) {
        super.visit(n, collector);
        collector.add(n);
    }
}
